<template>
  <div class="dashboard-editor-container">
    <!-- <div class="app-container"> -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="微博发布时间" prop="发布时间">
        <el-date-picker clearable
          v-model="queryParams.发布时间"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择微博发布时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="微博发布所在周" prop="week">
        <el-input
          v-model="queryParams.week"
          placeholder="请输入微博发布所在周"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="微博发布所在月" prop="month">
        <el-input
          v-model="queryParams.month"
          placeholder="请输入微博发布所在月"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="微博发布所在年" prop="year">
        <el-input
          v-model="queryParams.year"
          placeholder="请输入微博发布所在年"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:weibv3copy:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:weibv3copy:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:weibv3copy:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:weibv3copy:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getWeibv32"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="weibv3copyList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="记录ID" align="center" prop="id" />
      <el-table-column label="微博页码" align="center" prop="页码" />
      <el-table-column label="微博ID" align="center" prop="微博id" />
      <el-table-column label="微博作者" align="center" prop="微博作者" />
      <el-table-column label="微博发布时间" align="center" prop="发布时间" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.发布时间, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="微博内容" align="center" prop="微博内容" />
      <el-table-column label="微博转发数" align="center" prop="转发数" />
      <el-table-column label="微博评论数" align="center" prop="评论数" />
      <el-table-column label="微博点赞数" align="center" prop="点赞数" />
      <el-table-column label="微博发布设备" align="center" prop="发布于" />
      <el-table-column label="微博发布IP所属城市" align="center" prop="ip属地城市" />
      <el-table-column label="微博发布IP所属省份" align="center" prop="ip属地省份" />
      <el-table-column label="微博发布IP所属国家" align="center" prop="ip属地国家" />
      <el-table-column label="微博发布所在周" align="center" prop="week" />
      <el-table-column label="微博发布所在月" align="center" prop="month" />
      <el-table-column label="微博发布所在年" align="center" prop="year" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:weibv3copy:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:weibv3copy:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getWeibv32"
    />

    <!-- 添加或修改微博信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  <!-- </div> -->

    
  </div>
</template>

<script>


export default {
  name: 'Index',
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart
  },
  data() {
    return {
      lineChartData: lineChartData.newVisitis
    }
  },
  methods: {
    handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type]
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
